www.geekybob.com

Just a short, simple blog for Bob to share his thoughts.

Adding Windows Phone 7 Support to BlogEngine.NET

08 December 2010 • by Bob • BlogEngine.NET, IIS, Windows Phone 7

I love BlogEngine.NET, and I love my Windows Phone 7 mobile phone, so it goes without saying that I would want the two technologies to work together. I'm currently using BlogEngine.NET 1.6.1, but Windows Phone 7 is not supported by default. That being said, it's really easy to add support for Windows Phone 7 by modifying your BlogEngine.NET settings. To do so, open your Web.config file and locate the following section:

<appSettings>
<add key="BlogEngine.FileExtension" value=".aspx" />
<!-- You can e.g. use "~/blog/" if BlogEngine.NET is not located in the root of the application -->
<add key="BlogEngine.VirtualPath" value="~/" />
<!-- The regex used to identify mobile devices so a different theme can be shown -->
<add key="BlogEngine.MobileDevices" value="(nokia|sonyericsson|blackberry|samsung|sec\-|windows ce|motorola|mot\-|up.b|midp\-)" />
<!-- The name of the role with administrator permissions -->
<add key="BlogEngine.AdminRole" value="Administrators" />
<!--This value is to provide an alterantive location for storing data.-->
<add key="StorageLocation" value="~/App_Data/" />
<!--A comma separated list of script names to hard minify. It's case-sensitive. -->
<add key="BlogEngine.HardMinify" value="blog.js,widget.js,WebResource.axd" />
</appSettings>

The line that you need to modify is the BlogEngine.MobileDevices line, and all that you need to do is add iemobile to the list. When you finish, it should look like the following:

<add key="BlogEngine.MobileDevices"
  value="(iemobile|nokia|sonyericsson|blackberry|samsung|sec\-|windows ce|motorola|mot\-|up.b|midp\-)" />

You could also add support for Apple products by using the following syntax:

<add key="BlogEngine.MobileDevices"
  value="(iemobile|iphone|ipod|nokia|sonyericsson|blackberry|samsung|sec\-|windows ce|motorola|mot\-|up.b|midp\-)" />

That's all there is to it. ;-]


Note: This blog was originally posted at http://blogs.msdn.com/robert_mcmurray/

Tag Cloud

11th-ACR 511th-MI-Company Access Add-ins ADSI Animals Antivaxxers AppCmd Apple Arizona Army Art ASP ASP.NET Atheism Authentication Bass Batch Files Bicycling BlogEngine.NET Blogging BSOD Business C# Campaigning Capitalism Cats Certificates Childhood Christianity Christmas Classic ASP Communism Computers Conspiracy Content Cookies COVID19 CPP Database Dell DIY Dogs Domain Administration Easter Ecology Education Effects Entertainment Environment Errors Essential-Tremor Exercise Expression Web Extensibility Facebook Family Fashion Feedback FFmpeg Filters Food FPSE Friends FrontPage FTP FTP Clients FTPS Gaming Germany GPO Grandparenting Guitar Halloween Hardware Hawaii Health History Hobbies Hotkeys HP HTML HTMLA HTTP HTTPS Humor IE IIS IIS 5 IIS 6 IIS 7 IIS 7.5 IIS 8 IIS 8.5 IIS Express Internet JavaScript Keystrokes Kickstarter Kids Languages LDAP Linguistics Log Files Log Parser LogParser Macros Marriage Math Media Membership Microsoft MIDI Military Miscellaneous Mods Movies Music Nature Nostalgia Office OneDrive Opinion Outlook PaintShop Parenthood Parody Peace Performance Philosophy Photography PHP Poetry Politics Ponderings PowerShell Programming Projects Proxy Puns PWS Random Thoughts Rants Religion Reviews RSCA Rush Russia Satire Science Scripting SDK Seattle Security SEO SharePoint Sibelius SkyDrive Socialism Space Sports Squirrels Squirrels, Humor SSI SSL Star Trek STEM Support Surface TechEd Technology Television Templates Thanksgiving Themes Transcription Travel Troubleshooting Tucson Upgrades URL URL Rewrite User Isolation VBA VBScript Video Visio Visual Basic Visual Studio VLC W3C Web API WebDAV WebMatrix Weight Loss WinCache Window Media Center Windows Windows 10 Windows Cache Extension Windows Phone 7 WMI Word Work Writing WSH XML XSL Zune